

***************************************************************************************************************************************************
***Replication for "Qui Bono? Foreign Military, Economic, Diplomatic Interventions, and the Termination of Civil Wars: An Integrative Approach"****
***************************************************************************************************************************************************
***************************************************************************************************************************************************





* For any questions/concerns please email to Huseyin Ilgaz at hui3@pitt.edu 

* Stata 16.1 is used for the analysis

* For a simple codebook for the variables after uploading data please use:

codebook, compact


************** ARTICLE MODELS

clear
set more off

use Article_published.dta, replace

*Table 2

label define Trajectories 1 "No Intervention"  2 "Diplomatic Intervention" 3 "Economic Sanction" 4 "Economic-Diplomatic Interventions" 5 "Military Intervention" 6 "Military-Diplomatic Intervention" 7 "Military-Economic Intervention" 8 "Military-Economic-Diplomatic Interventions"

label values Trajectory_2 Trajectories

tab Trajectory_2 

*************************************************************
*************************************************************


*Table 3

tabstat Trajectory_2 state_mil rebel_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, s(n mean sd min max) format(%10.2fc)

*************************************************************
*************************************************************

* Table 4, Figure 1, Figure 2, Figure 3, and Figure 4


** The models in Table 4 are presented in a condensed form. Original models can be produced using this replication file. 

** Given that there are multiple interactions, some of which are not relevant to the hypotheses presented, I put in Table 4 only those that are most relevant to the theoretical discussion and the hypotheses. 

** The below models are presented for each termination outcome type. 



***Negotiated Settlement (NS) Outcome Models

* Diplomatic and Economic interventions on NS


stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4) noshr

* Figure 1

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4) noshr

stcurve, lcolor(black gray) lpattern(solid dash)  cif at1(Trajectory_2=2) at2(Trajectory_2=1) title("") legend( order(1 "Diplomatic Intervention*** (%1484)" 2 "No-Intervention") position (6) size(normalsize))  xtitle("{bf:Duration of Conflict in Years}") ytitle("{bf:Probability}")

* Figure 2

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4) noshr

stcurve, lcolor(black black gray) lpattern(solid longdash_dot dash)  cif at1(Trajectory_2=4) at2(Trajectory_2=3) at3(Trajectory_2=1) title("") legend( order(1 "Economic-Diplomatic Interventions** (%461)" 2 "Economic Intervention (%103)" 3 "No-Intervention") position (6) size(normalsize)) xtitle("{bf:Duration of Conflict in Years}") ytitle("{bf:Probability}")


* State-biased military interventions on NS 

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#state_mil polity2_conv lngdp_pc intensity_1 Incompatibility rel_reb_strength pcw, compete(termination == 3 4) vce(cluster DyadId) tvc(i.Trajectory_2#state_mil Incompatibility lngdp_pc ) texp(ln(_t)) noshr


* Figure #3 (run to the end (till the indicated line below) all code lines together)

* e(b)        coefficient vector
* e(V)        variance-covariance matrix of the estimates (VCE)

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#state_mil polity2_conv lngdp_pc intensity_1 Incompatibility rel_reb_strength pcw, compete(termination == 3 4) vce(cluster DyadId) tvc(i.Trajectory_2#state_mil Incompatibility lngdp_pc ) texp(ln(_t)) noshr


mat def b = e(b)
mat def V = e(V)
gen lnt = ln(_t)

/*Calculate combined coefficient and graph it*/ 

	
gen LI= _b[5.Trajectory_2#1.state_mil]+b[1,32]*lnt		/*Generate combined coefficient*/
	
sum LI

 * ereturn list

	gen se_LI= sqrt(V[10,10] + lnt^2*V[32,32]+2*lnt*V[10,32])			/*Generate standard error of combined coefficient*/

sum se_LI



	gen LI_lo= LI-1.96*se_LI								/*Generate 95% confidence intervals*/
	
	gen LI_hi=LI+1.96*se_LI


sum LI*

gen years = _t
sum years


#delimit ;
line  LI LI_lo LI_hi years, lcolor(black black black) lwidth(thick thin thin) sort
		xline(2.45, lcolor(gs5) lwidth(vvthin)) 
		xline(8, lcolor(gs5) lwidth(vvthin)) 
		yline(0, lcolor(gs5) lwidth(vvthin))
		xtitle("Duration of Conflict in Years") ytitle("Combined Coefficient") 
		legend(off)
		name(LIGW, replace)
		scheme(s1manual);
#delimit cr

** For Figure #3 run until here 




* Rebel-sided military interventions on NS

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

 
stcrreg i.Trajectory_2#rebel_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 3 4) vce(cluster DyadId) noshr


***State Victory (SV) Outcome Models


stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 3) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)


* Economic sanctions on SV 

stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 4) noshr


* State-biased military interventions on SV 

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 3) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#state_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 4) noshr


* Rebel-biased military interventions on SV

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 3) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#rebel_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 4) noshr


***Rebel Victory (RV) Outcome Models

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

* Economic sanctions on RV

stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 3) noshr


* State-sided military interventions on RV 

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#state_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 3) vce(cluster DyadId) noshr

* Rebel-sided military interventions on RV  

clear
set more off

use Article_published.dta, replace


stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#rebel_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 3) vce(cluster DyadId) tvc(i.Trajectory_2#rebel_mil intensity rel_reb_strength) texp(ln(_t)) noshr


* Figure #4 (run to the end (till the indicated line below) all code lines together) 

* e(b)        coefficient vector
* e(V)        variance-covariance matrix of the estimates (VCE)

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

stcrreg i.Trajectory_2#rebel_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 3) vce(cluster DyadId) tvc(i.Trajectory_2#rebel_mil intensity rel_reb_strength) texp(ln(_t)) noshr

mat def b = e(b)
mat def V = e(V)
gen lnt = ln(_t)

mat list b

/*Calculate combined coefficient and graph it*/ 

	
	gen LI= _b[7.Trajectory_2#1.rebel_mil]+b[1,36]*lnt		/*Generate combined coefficient*/

	
sum LI

 * ereturn list
 
 mat list V


	gen se_LI= sqrt(V[14,14] + lnt^2*V[36,36]+2*lnt*V[14,36])			/*Generate standard error of combined coefficient*/

sum se_LI



	gen LI_lo= LI-1.96*se_LI								/*Generate 95% confidence intervals*/
	
	gen LI_hi=LI+1.96*se_LI


sum LI*

gen years = _t
sum years


#delimit ;
line  LI LI_lo LI_hi years, lcolor(black black black) lwidth(thick thin thin) sort
		xline(1.7, lcolor(gs5) lwidth(vvthin)) 
		yline(0, lcolor(gs5) lwidth(vvthin))
		xtitle("Duration of Conflict in Years") ytitle("Combined Coefficient")
		legend(off)
		name(LIGW, replace)
		scheme(s1manual);
#delimit cr

** For Figure #4 run until here







************** APPENDIX MODELS

*** TableA1

** Negotiated Settlement Outcomes 

clear
set more off

use Article_published.dta, replace

eststo clear
stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)


eststo Model_1: quietly stcrreg i.Trajectory_2, compete(Outcome=3 4) vce(cluster DyadId) noshr

eststo Model_2: quietly stcrreg i.Trajectory_2#state_mil, compete(Outcome=3 4) vce(cluster DyadId) noshr

eststo Model_3: quietly stcrreg i.Trajectory_2#rebel_mil, compete(Outcome=3 4) vce(cluster DyadId) noshr

estout, eform cells(b(star fmt(3)))starlevels( * 0.10 ** 0.05 *** 0.01) label drop(1.Trajectory_2 1.Trajectory_2#0.state_mil 1.Trajectory_2#1.state_mil 1.Trajectory_2#0.rebel_mil 1.Trajectory_2#1.rebel_mil 2.Trajectory_2#0.state_mil 2.Trajectory_2#1.state_mil 2.Trajectory_2#0.rebel_mil 2.Trajectory_2#1.rebel_mil 3.Trajectory_2#0.state_mil 3.Trajectory_2#1.state_mil 3.Trajectory_2#0.rebel_mil 3.Trajectory_2#1.rebel_mil 4.Trajectory_2#0.state_mil 4.Trajectory_2#1.state_mil 4.Trajectory_2#0.rebel_mil 4.Trajectory_2#1.rebel_mil 5.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#0.rebel_mil 6.Trajectory_2 6.Trajectory_2#0.state_mil 6.Trajectory_2#0.rebel_mil 7.Trajectory_2 7.Trajectory_2#0.state_mil 7.Trajectory_2#0.rebel_mil 8.Trajectory_2 8.Trajectory_2#0.state_mil 8.Trajectory_2#0.rebel_mil) order(2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#1.state_mil 5.Trajectory_2#0.rebel_mil 5.Trajectory_2#1.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#1.state_mil 6.Trajectory_2#0.rebel_mil 6.Trajectory_2#1.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#1.state_mil 7.Trajectory_2#0.rebel_mil 7.Trajectory_2#1.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#1.state_mil 8.Trajectory_2#0.rebel_mil 8.Trajectory_2#1.rebel_mil)

esttab using TableA1.doc, eform replace drop(1.Trajectory_2 5.Trajectory_2 6.Trajectory_2 7.Trajectory_2 8.Trajectory_2 1.Trajectory_2#0.state_mil 1.Trajectory_2#1.state_mil 1.Trajectory_2#0.rebel_mil 1.Trajectory_2#1.rebel_mil 2.Trajectory_2#0.state_mil 2.Trajectory_2#1.state_mil 2.Trajectory_2#0.rebel_mil 2.Trajectory_2#1.rebel_mil 3.Trajectory_2#0.state_mil 3.Trajectory_2#1.state_mil 3.Trajectory_2#0.rebel_mil 3.Trajectory_2#1.rebel_mil 4.Trajectory_2#0.state_mil 4.Trajectory_2#1.state_mil 4.Trajectory_2#0.rebel_mil 4.Trajectory_2#1.rebel_mil 5.Trajectory_2#0.state_mil 5.Trajectory_2#0.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#0.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#0.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#0.rebel_mil) order(2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#1.state_mil 5.Trajectory_2#0.rebel_mil 5.Trajectory_2#1.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#1.state_mil 6.Trajectory_2#0.rebel_mil 6.Trajectory_2#1.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#1.state_mil 7.Trajectory_2#0.rebel_mil 7.Trajectory_2#1.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#1.state_mil 8.Trajectory_2#0.rebel_mil 8.Trajectory_2#1.rebel_mil) ///
noconstant label b(3) se(2) ///
scalars("ll Pseudo loglikelihood") ///
mtitles("Model 1" "Model 2" "Model 3") ///
interaction(" x ") ///
note(Notes: The models in this table are presented in a condensed form.) 


** State Victory Outcomes 

* Table A1 (Continued) 

eststo clear
stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 3) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

eststo Model_4: quietly stcrreg i.Trajectory_2, compete(Outcome=1 4) vce(cluster DyadId) noshr

eststo Model_5: quietly stcrreg i.Trajectory_2#state_mil, compete(Outcome=1 4) vce(cluster DyadId) noshr

eststo Model_6: quietly stcrreg i.Trajectory_2#rebel_mil, compete(Outcome=1 4) vce(cluster DyadId) noshr

estout, eform cells(b(star fmt(3)))starlevels( * 0.10 ** 0.05 *** 0.010) label drop(1.Trajectory_2 1.Trajectory_2#0.state_mil 1.Trajectory_2#1.state_mil 1.Trajectory_2#0.rebel_mil 1.Trajectory_2#1.rebel_mil 2.Trajectory_2#0.state_mil 2.Trajectory_2#1.state_mil 2.Trajectory_2#0.rebel_mil 2.Trajectory_2#1.rebel_mil 3.Trajectory_2#0.state_mil 3.Trajectory_2#1.state_mil 3.Trajectory_2#0.rebel_mil 3.Trajectory_2#1.rebel_mil 4.Trajectory_2#0.state_mil 4.Trajectory_2#1.state_mil 4.Trajectory_2#0.rebel_mil 4.Trajectory_2#1.rebel_mil 5.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#0.rebel_mil 6.Trajectory_2 6.Trajectory_2#0.state_mil 6.Trajectory_2#0.rebel_mil 7.Trajectory_2 7.Trajectory_2#0.state_mil 7.Trajectory_2#0.rebel_mil 8.Trajectory_2 8.Trajectory_2#0.state_mil 8.Trajectory_2#0.rebel_mil) order(2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#1.state_mil 5.Trajectory_2#0.rebel_mil 5.Trajectory_2#1.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#1.state_mil 6.Trajectory_2#0.rebel_mil 6.Trajectory_2#1.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#1.state_mil 7.Trajectory_2#0.rebel_mil 7.Trajectory_2#1.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#1.state_mil 8.Trajectory_2#0.rebel_mil 8.Trajectory_2#1.rebel_mil)

esttab using TableA1_1.doc, eform replace drop(1.Trajectory_2 5.Trajectory_2 6.Trajectory_2 7.Trajectory_2 8.Trajectory_2 1.Trajectory_2#0.state_mil 1.Trajectory_2#1.state_mil 1.Trajectory_2#0.rebel_mil 1.Trajectory_2#1.rebel_mil 2.Trajectory_2#0.state_mil 2.Trajectory_2#1.state_mil 2.Trajectory_2#0.rebel_mil 2.Trajectory_2#1.rebel_mil 3.Trajectory_2#0.state_mil 3.Trajectory_2#1.state_mil 3.Trajectory_2#0.rebel_mil 3.Trajectory_2#1.rebel_mil 4.Trajectory_2#0.state_mil 4.Trajectory_2#1.state_mil 4.Trajectory_2#0.rebel_mil 4.Trajectory_2#1.rebel_mil 5.Trajectory_2#0.state_mil 5.Trajectory_2#0.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#0.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#0.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#0.rebel_mil) order(2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#1.state_mil 5.Trajectory_2#0.rebel_mil 5.Trajectory_2#1.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#1.state_mil 6.Trajectory_2#0.rebel_mil 6.Trajectory_2#1.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#1.state_mil 7.Trajectory_2#0.rebel_mil 7.Trajectory_2#1.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#1.state_mil 8.Trajectory_2#0.rebel_mil 8.Trajectory_2#1.rebel_mil) ///
noconstant label b(3) se(2) ///
scalars("ll Pseudo loglikelihood") ///
mtitles("Model A4" "Model A5" "Model A6") ///
interaction("#") ///
note(Notes: The models in this table are presented in a condensed form.) 

** Rebel Victory Outcomes 

* Table A1 (Continued) 

eststo clear
stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

eststo Model_7: quietly stcrreg i.Trajectory_2, compete(Outcome=1 3 ) vce(cluster DyadId) noshr

eststo Model_8: quietly stcrreg i.Trajectory_2#state_mil, compete(Outcome=1 3) vce(cluster DyadId) noshr

eststo Model_9: quietly stcrreg i.Trajectory_2#rebel_mil, compete(Outcome=1 3) vce(cluster DyadId) noshr

estout, eform cells(b(star fmt(3)))starlevels( * 0.10 ** 0.05 *** 0.010) label drop(1.Trajectory_2 1.Trajectory_2#0.state_mil 1.Trajectory_2#1.state_mil 1.Trajectory_2#0.rebel_mil 1.Trajectory_2#1.rebel_mil 2.Trajectory_2#0.state_mil 2.Trajectory_2#1.state_mil 2.Trajectory_2#0.rebel_mil 2.Trajectory_2#1.rebel_mil 3.Trajectory_2#0.state_mil 3.Trajectory_2#1.state_mil 3.Trajectory_2#0.rebel_mil 3.Trajectory_2#1.rebel_mil 4.Trajectory_2#0.state_mil 4.Trajectory_2#1.state_mil 4.Trajectory_2#0.rebel_mil 4.Trajectory_2#1.rebel_mil 5.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#0.rebel_mil 6.Trajectory_2 6.Trajectory_2#0.state_mil 6.Trajectory_2#0.rebel_mil 7.Trajectory_2 7.Trajectory_2#0.state_mil 7.Trajectory_2#0.rebel_mil 8.Trajectory_2 8.Trajectory_2#0.state_mil 8.Trajectory_2#0.rebel_mil) order(2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#1.state_mil 5.Trajectory_2#0.rebel_mil 5.Trajectory_2#1.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#1.state_mil 6.Trajectory_2#0.rebel_mil 6.Trajectory_2#1.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#1.state_mil 7.Trajectory_2#0.rebel_mil 7.Trajectory_2#1.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#1.state_mil 8.Trajectory_2#0.rebel_mil 8.Trajectory_2#1.rebel_mil)

esttab using TableA1_2.doc, eform replace drop(1.Trajectory_2 5.Trajectory_2 6.Trajectory_2 7.Trajectory_2 8.Trajectory_2 1.Trajectory_2#0.state_mil 1.Trajectory_2#1.state_mil 1.Trajectory_2#0.rebel_mil 1.Trajectory_2#1.rebel_mil 2.Trajectory_2#0.state_mil 2.Trajectory_2#1.state_mil 2.Trajectory_2#0.rebel_mil 2.Trajectory_2#1.rebel_mil 3.Trajectory_2#0.state_mil 3.Trajectory_2#1.state_mil 3.Trajectory_2#0.rebel_mil 3.Trajectory_2#1.rebel_mil 4.Trajectory_2#0.state_mil 4.Trajectory_2#1.state_mil 4.Trajectory_2#0.rebel_mil 4.Trajectory_2#1.rebel_mil 5.Trajectory_2#0.state_mil 5.Trajectory_2#0.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#0.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#0.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#0.rebel_mil) order(2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2#0.state_mil 5.Trajectory_2#1.state_mil 5.Trajectory_2#0.rebel_mil 5.Trajectory_2#1.rebel_mil 6.Trajectory_2#0.state_mil 6.Trajectory_2#1.state_mil 6.Trajectory_2#0.rebel_mil 6.Trajectory_2#1.rebel_mil 7.Trajectory_2#0.state_mil 7.Trajectory_2#1.state_mil 7.Trajectory_2#0.rebel_mil 7.Trajectory_2#1.rebel_mil 8.Trajectory_2#0.state_mil 8.Trajectory_2#1.state_mil 8.Trajectory_2#0.rebel_mil 8.Trajectory_2#1.rebel_mil) ///
scalars("ll Pseudo loglikelihood") ///
noconstant label b(3) se(2) mgroups(none) ///
mtitles("Model A7" "Model A8" "Model A9") ///
interaction("#") ///
note(Notes: The models in this table are presented in a condensed form.) 

*************************************************************
*************************************************************

*** TableA2

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)



estimates clear
foreach model in exponential weibull gompertz lognormal loglogistic { 
	quietly streg i.Trajectory_2 i.Incompatibility i.intensity i.rel_reb_strength i.pcw lngdp_pc i.polity2_conv, dist(`model')
	estimates store `model'
}

estimates stats _all

*************************************************************
*************************************************************


*** TableA3

clear
set more off

use Article_published.dta, replace
estimates clear

label variable intensity "Intensity of Conflict"
label variable rel_reb_strength "Relative Strength"
label variable pcw "Post-Cold War"
label variable lngdp_pc "GDP per capita" 
label variable polity2_conv "Polity Score" 
label variable land "Number of Neighbors"
label variable numdyads "Number of Dyads"
label variable ln_trade "The Rate of Trade"
label variable dipint "Diplomatic Intervention" 
label variable ecoint "Economic Intervention"
label variable milint "Military Intervention"
label variable seq "Duration of Conflict"
label variable seq_2 "Duration of Conflict_square"

** Selection-Stage Probit Models for Each Intervention Type

eststo: quietly probit dipint Incompatibility intensity_1 rel_reb_strength pcw lngdp_pc polity2_conv seq seq_2 milint ecoint land numdyads, cluster(DyadId_2)

predict IMR_dip, score

* Instrumental variables for diplomatic intervention: land, numdyads

eststo: quietly probit ecoint Incompatibility intensity_1 rel_reb_strength pcw lngdp_pc polity2_conv seq seq_2 milint dipint ln_trade, cluster(DyadId_2)

predict IMR_eco, score

//// missing values are due to ln_trade & rel.strength
* Instrumental variables for economic sanctions: ln_trade
* ln_trade is the proportion of world trade (derived from the variable trade5)

eststo: quietly probit milint Incompatibility intensity_1 rel_reb_strength pcw lngdp_pc polity2_conv seq seq_2 ecoint dipint ln_trade numdyads, cluster(DyadId_2)

predict IMR_mil, score

* Instrumental variables for military interventions: ln_trade, numdyads

label variable IMR_dip "IMR_Diplomatic Interventions"
label variable IMR_eco "IMR_Economic Interventions"
label variable IMR_mil "IMR_Military Interventions"

* selection-stage table

esttab, label starlevels(* 0.10 ** 0.05 *** 0.01) order(polity2_conv lngdp_pc intensity_1 Incompatibility  rel_reb_strength pcw milint ecoint dipint seq seq_2 land numdyads ln_trade) noconstant 

esttab using TableA3.doc, replace label starlevels(* 0.10 ** 0.05 *** 0.01) order(polity2_conv lngdp_pc intensity_1 Incompatibility  rel_reb_strength pcw milint ecoint dipint seq seq_2 land numdyads ln_trade) noconstant 

*************************************************************
*************************************************************

*** TableA4

* outcome stage (OLS form of log normal duration model)

gen log_dur = log(seq)
sum log_dur

label define e 1 "No-Intervention"  2 "Diplomatic Intervention" 3 "Economic Intervention." 4 "Economic and Diplomatic Interventions" 5 "Military Intervention" 6 "Military and Diplomatic Interventions" 7 "Military and Economic Interventions" 8 "Military, Economic, and Diplomatic Int."

label values Trajectory_2 e

estimates clear

eststo: quietly  regress log_dur i.Trajectory_2 Incompatibility intensity rel_reb_strength pcw lngdp_pc polity2_conv, robust cluster(DyadId_2)

eststo: quietly regress log_dur IMR_mil IMR_eco IMR_dip i.Trajectory_2 Incompatibility intensity rel_reb_strength pcw lngdp_pc polity2_conv, robust cluster(DyadId_2)

esttab, label starlevels(* 0.10 ** 0.05 *** 0.01) drop (1.Trajectory_2)order(IMR_dip IMR_eco IMR_mil 2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2 6.Trajectory_2 7.Trajectory_2 8.Trajectory_2 polity2_conv lngdp_pc intensity_1 Incompatibility rel_reb_strength pcw) 

esttab using TableA4.doc, replace label starlevels(* 0.10 ** 0.05 *** 0.01)  drop (1.Trajectory_2)order(IMR_dip IMR_eco IMR_mil 2.Trajectory_2 3.Trajectory_2 4.Trajectory_2 5.Trajectory_2 6.Trajectory_2 7.Trajectory_2 8.Trajectory_2 polity2_conv lngdp_pc intensity_1 Incompatibility rel_reb_strength pcw) 

*************************************************************
*************************************************************


****TABLE A5. Mediator Leverage and Conflict Outcomes 

** A new variable is constructed to check for mediator leverage. 
** There are different types of mediations that could take place in civil wars. In most, multiple international actors are getting involved in the diplomatic process. These actors could also include both state and non-state parties. In operationalizing this set of actors, similar to Reid (2017), I use the mediator’s GDP with the maximum value of all third parties involved in the process. As for the non-country parties, I excluded non-state mediators from having economic leverage. Existing scholarship regards these actors as weaker mediator categories (Svensson 2009). However, given its primacy in diplomatic efforts, the UN is included in the analysis. I used the UN annual budget in US dollars equivalent to the UN’s GDP over the years between 1971 and 2007 (Hufner 2013). The relative GDP score is calculated by dividing the mediator’s GDP (the maximum value in multiple mediators) by the GDP of the conflict country. 

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

* stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw ln_rel_gdp_DI, vce(cluster DyadId) compete(termination == 3 4) noshr

stcrreg i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw ln_rel_gdp_DI, vce(cluster DyadId) compete(termination == 3 4)

*************************************************************
*************************************************************

****TABLE A6. State vs. Organization-led Mediations

** For military interventions, consistent with the data source—UCDP Dyadic Dataset, both individual states and international organizations are included in the analysis. However, organizations involved in military interventions are included in the dataset by coding each participating state rather than namely identifying the organization itself—such as including each participant country within NATO intervention in Afghanistan. For economic sanctions, both state and organization-imposed sanctions are included by their identity in the analysis, which is also the same for diplomatic mediations. Furthermore, building upon the integration of third-party leverage into the analysis mentioned in point #1 above, I have differentiated between individual states and non-state actors  (international/regional organizations and other actors) in the empirical analysis. 

* Note that results are in SHR rather than coefficients. You can use noshr option at the end of the model to get results in coefficients as well. 

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)


gen Dip_3P_Org = . 


foreach n of varlist Dip_3P_1 Dip_3P_2 Dip_3P_3 Dip_3P_4 Dip_3P_5 Dip_3P_6 Dip_3P_7 Dip_3P_8 {
	
	replace Dip_3P_Org = 1 if `n' == 1000 | `n' == 2000 | `n' == 3000 | `n' == 4000 | `n' == 5000 | `n' == 6000 | `n' == 7000 | `n' == 8000 | `n' == 9000 | `n' == 9001 | `n' == 9002 | `n' == 9003 | `n' == 9004 | `n' == 9005
	replace Dip_3P_Org = 0 if Dip_3P_Org != 1
}


stcrreg i.Trajectory_2#Dip_3P_Org polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4)

*************************************************************
*************************************************************

*** TABLE A7. Multinominal Logit Model (Pooled)

clear
set more off

use Article_published.dta, replace

recode termination (2 5 6 = 0) (3 = 2) (4 = 3), gen(termination_1)
label variable termination_1 "Multilogit DV" 
label define termination_1 0 "Continuing" 1 "Negotiated Settlement" 2 "State Victory" 3 "Rebel Victory"

* Only the first one (pooled results) is presented in the Appendix
mlogit termination_1 i.Trajectory_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, robust cluster(DyadId_2) cformat(%9.2f)

mlogit termination_1 i.Trajectory_2#state_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, robust cluster(DyadId_2)
mlogit termination_1 i.Trajectory_2#rebel_mil polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, robust cluster(DyadId_2)

** but the problem with mlogit is the critical assumption for Independence of Irrelevant Alternatives (IIA). THat is,  Odds of one outcome versus another should be independent of other alternatives. But in my case, I argue that the alternatives are dependent on each other. 
** Long and Freese (2006), quoting Mcfadden: “Multinomial and conditional logit models should only be used in cases where the alternatives “can plausibly be assumed to be distinct and weighed independently in the eyes of the decisionmaker.”
*in order test for IIA

*************************************************************
*************************************************************

*** TABLE A8. Models using UCDP External Support Dataset - Negotiated Settlement Outcome

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

* State-sided support

stcrreg external_type__X external_type__W external_type__M external_type__ external_type__I polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4) cformat(%9.2f)


* Rebel-sided support

stcrreg external_type__X_2 external_type__W_2 external_type__M_2 external_type___2 external_type__I_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4) cformat(%9.2f)

*************************************************************
*************************************************************

*** TABLE A9. Models using UCDP External Support Dataset - State Victory Outcome

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 3) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

* State-sided support

stcrreg external_type__X external_type__W external_type__M external_type__ external_type__I polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 4) cformat(%9.2f)

* Rebel-sided support

stcrreg external_type__X_2 external_type__W_2 external_type__M_2 external_type___2 external_type__I_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 4) cformat(%9.2f)

*************************************************************
*************************************************************

*** TABLE A10. Models using UCDP External Support Dataset - Rebel Victory Outcome

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

* State-sided support

stcrreg external_type__X external_type__W external_type__M external_type__ external_type__I polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 3) cformat(%9.2f)

* Rebel-sided support

stcrreg external_type__X_2 external_type__W_2 external_type__M_2 external_type___2 external_type__I_2 polity2_conv lngdp_pc intensity Incompatibility rel_reb_strength pcw, compete(termination == 1 3) cformat(%9.2f)
 
*************************************************************
*************************************************************

*** TABLE A11. Models using Cumulative Battle-related Death Data

clear
set more off

use Article_published.dta, replace


** lnbrd (battle-related deaths (BRD)--natural log transformed) is available only starting with Year 1989


** BRD on Negotiated Settlement Outcome

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 1) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)

gen lnt = ln(_t) 

stcrreg i.Trajectory_2 polity2_conv lngdp_pc lnbrd c.lnbrd#c.lnt Incompatibility rel_reb_strength pcw, vce(cluster DyadId) compete(termination == 3 4) cformat(%9.2f)

* with the inclusion of brd and time interaction, it suggests that (similar to state biased milint and negotiated statement effect), it initially decreases the probability of a negotiated settlement. However, it changes effect over time and increases the prospect of a negotiated solution as the conflict endures. 


** BRD on State Victory Outcome

clear
set more off

use Article_published.dta, replace


stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 3) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)


stcrreg i.Trajectory_2 polity2_conv lngdp_pc lnbrd Incompatibility rel_reb_strength pcw, compete(termination == 1 4) cformat(%9.2f)


* BRD  on Rebel Victory Outcome

clear
set more off

use Article_published.dta, replace

stset Year2, origin(time Year_0) id(DyadId_2) failure(termination == 4) time0(Year_0) scale(365)
replace _t = round(_t,1)
replace _t0 = round(_t0,1)


stcrreg i.Trajectory_2 polity2_conv lngdp_pc lnbrd Incompatibility rel_reb_strength pcw, compete(termination == 1 3) cformat(%9.2f)

****** The End **********
